#ifndef XMLBLOCK_H
#define XMLBLOCK_H

#include <QString>
#include <QStringList>
#include <QHash>
#include "xmlObj.h"
#include "xmlDep.h"

class node;

class xmlBlock : public xmlObj {

private:
    QString isNotRepairable;
    QString term1ID;
    QString term2ID;
    QString trigger_block_ID;
    QString state;
    QString cdfFailure;
    QString cdfActive;
    QHash<QString,int> *cdfDip;
    //QList<QString> *cdfDip;
    QStringList trigger_event_type;
    QStringList reaction_event_type;
    QList<xmlDep *> *depList;
    QHash<int, QString> *logicConditionCircleDep; //condizioni logiche dei cicleDep del nodo
    xmlDep *failureDep;
    xmlDep *activeDep;

    int numMergedDep; //contatore mergeDep (quanti pallini ho disegnato)
    QList<int> *listIdMergedDep; //lista identificatori meredDep
    int idMergedDep;//identificaori

    bool isPainted;
    node * myNodeConteiner;

    double x; //posizione x del nodo che contiene questo xmlBlock
    double y; //posizione y ...

public:
    void setIsNotRepairable(QString value);
    QString getIsNotRepairable();
    void setCdfFailure(QString value);
    void setCdfActive(QString value);
    void setTerm1ID(QString value);
    void setTerm2ID(QString value);
    //void setTrigger_block_ID(QString value);
    void setState(QString value);
    //void setTrigger_event_type(QStringList head);
    //void setReaction_event_type(QStringList head);
    void setIsPainted(bool value);
    void setDepList(QList<xmlDep *> *value);
    void setMyNodeConteiner(node * value);
    //void setCdfDip (QList<QString> *value);
    void setCdfDip (QHash<QString,int> *value);
    void increaseNumMergedDep();
    void decreaseNumMergedDep();
    void setNumMergedDep(int value);
    int getNumMergedDep();
    void setFailureDep(xmlDep *value);
    void setActiveDep(xmlDep *value);

    int getIdMergedDep();
    void setIdMergedDep(int value);
    void increaseIdMergedDep();
    void insertListIdMergedDep(int value);
    void removeListIdMergedDep(int value);
    QList<int> * getListIdMergedDep();
    void setIds(QStringList ids);


    //QList<QString> *getCdfDip();
    QHash<QString,int> *getCdfDip();
    QString getCdfFailure();
    QString getCdfActive();
    QString getTerm1ID();
    QString getTerm2ID();
    QString getTrigger_block_ID();
    QString getState();
    QStringList getTrigger_event_type();
    QStringList getReaction_event_type();
    xmlDep *getFailureDep();
    xmlDep *getActiveDep();
    bool getIsPainted();
    QList<xmlDep *> *getDepList();
    node * getMyNodeConteiner();
    void setLogicConditionCircleDep(QString condition, int numCircleDep);
    QString getLogicConditionCircleDep(int numCircleDep);
    void delLogicConditionCircleDep(int numCircleDep);

    double getX();
    double getY();

    void setX(QString value);
    void setY(QString value);

public:
    xmlBlock();

};

#endif // XMLBLOCK_H
